<%@ page language="java" contentType="text/html; charset=ISO-8859-1"  pageEncoding="ISO-8859-1"%>
<%@ taglib prefix ="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<jsp:include page="/jsp/part/header.jsp" />
	<title>Maxi ERP</title>
</head>
<body>
	<div class="contenu">
		<jsp:include page="/jsp/part/menu.jsp" />
		<div class="container-fluid">
			<div class="row-fluid">
				<div id="left_menu" class="span3">
					<jsp:include page="/jsp/part/action_menu.jsp" />
				</div>
				<div class="span9">
					<!-- listing -->
					<h2>Liste des achats</h2>

					<div>
						<table class="table table-bordered table-striped table-hover">
							<thead>
								<tr>
									<th> # </th>
									<th> Action </th>
									<th> Client </th>
									<th> Date </th>
									<th> Prix </th>
								</tr>
							</thead>
							<tbody>
								<!--  while -->
								<c:if test="${list_purchases != null}">
									<c:forEach items="${list_purchases}" var="item">
										<tr>								
											<td><c:out value="${item.id}"/></td>
											<td style="text-align:center">
												<i class="icon icon-eye-open tooltip_top" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="<c:forEach items='${item.list_products}' var='product'>
																																										<c:out value='${product.product.name}'/> x<c:out value='${product.qte}'/><br>
																																									</c:forEach>"></i>
											</td>
											<td> <c:out value="${item.customer.firstName}"/> <c:out value="${item.customer.lastName}"/></td>
											<td> <c:out value="${item.date}"/> </td>
											<td> <c:out value="${item.total_price}"/> </td>
										</tr> 
									</c:forEach>
								</c:if>
							</tbody>	
						</table>
					</div>	

				</div>
			</div>
		</div>
	</div>

</body>
</html>